<template>
	<view>
		<!-- <uni-nav-bar height="65px" dark shadow left-icon="left" leftText="返回" rightText="设置" title="自定义高度" /> -->
		<view class="">
			<image src="https://z4a.net/images/2024/07/16/3333.png" mode="widthFix" class="widthFiximg"></image>
		</view>

		<view :style="{ height: heightSystemss*2 + 'rpx' }"></view>
		<view v-if="circleImgShow==2" class="suspension" @click="addEmployeeSuspension()">
			<image class="addIcon" :src="camera" mode="aspectFit"></image>
		</view>
		<view>

			<custom-tabs type="c1" :value="value" :animation="true" :defaultTextStyle="{'color':'#333333'}"
				:activeTextStyle="{color:'#000000','font-weight':700}"
				:activeLineStyle="{'background-color':'#785DF6',height:'10rpx'}"
				@change="e=>changeIndex(e,tabList[e.value].id)">

				<block v-for="(item,index) in tabList" :key="index">
					<custom-tab-pane :label="item.name" name="c1_1" v-if="item.id==1&&item.state==1">


						<scroll-view :scroll-y="true" :style="{ height: windowHeight + 'px',  }">
							<daZi v-if="value==index" :show="show" @sortBol="sortBolFn" :sortXcx="sort"></daZi>
						</scroll-view>


					</custom-tab-pane>
					<custom-tab-pane :label="item.name" name="c1_2" v-if="item.id==2&&item.state==1">

						<!-- <scroll-view :scroll-y="true" :style="{ height: windowHeight + 'px',  }"> -->
							<wechatMoments v-if="value==index" :reachBottomWechat="reachBottomWechat" :show="show" @circleSortBol="circleSortBolFn"
								:sortXcx="sort"></wechatMoments>
					<!-- 	</scroll-view> -->


					</custom-tab-pane>
					<custom-tab-pane :label="item.name" name="c1_3" v-if="item.id==3&&item.state==1">
						<scroll-view :scroll-y="true" :style="{ height: windowHeight + 'px',  }">
							<serviceList v-if="value==index" :show="show" @serviceSortBol="serviceSortBolFn"
								:sortXcx="sort"></serviceList>
						</scroll-view>


					</custom-tab-pane>
					<custom-tab-pane :label="item.name" name="c1_4" v-if="item.id==4&&item.state==1">
						<!-- <scroll-view :scroll-y="true" :style="{ height: windowHeight + 'px',  }"> -->
							<socialList v-if="value==index" :reachBottomSocial="reachBottomSocial" :show="show" :formScreens="formTest"
								@socialSortBol="socialSortBolFn"></socialList>
						<!-- </scroll-view> -->

					</custom-tab-pane>

					<custom-tab-pane :label="item.name" name="c1_5" v-if="item.id==5&&item.state==1">
						<!-- <scroll-view :scroll-y="true" :style="{ maxHeight: windowHeight + 'px',  }"> -->
							<community v-if="value==index" :show="show" @communityPhoneBol="communityPhoneBolFn">
							</community>
						<!-- </scroll-view> -->

					</custom-tab-pane>

				</block>


			</custom-tabs>

			<tqb-tabbar activeIndex="0" />
		</view>
		<sunui-popup ref="modifyEmployeeInfo">
			<template v-slot:content>

				<view class="moreActiveButton">
					<view class="add" @click.stop="authorityFn(1)">
						距离
					</view>
					<view class="add" @click.stop="authorityFn(2)">
						时间
					</view>
					<view class="add" @click.stop="authorityFn(3)">
						默认
					</view>


				</view>

			</template>
		</sunui-popup>
		<sunui-popup ref="phoneLogin">
			<template v-slot:content>

				<view class="padding20" style="background-color: #FFFFFF;">
					<view class="text-align_center margin-top_20rpx font-weight_bold">
						手机号校验方便联系你
					</view>
					<view>


						<view class="margin_40rpx_0">
							手机号
						</view>

						<view class="getPhone flex  ">

							<input v-model="form.phone" type="number" maxlength="11" name="phone"
								placeholder="请输入手机号" />


						</view>



					</view>
					<view>
						<view class="margin_40rpx_0">
							验证码
						</view>
						<view class="getPhone flex  ">

							<input v-model="form.sms_code" type="number" maxlength="11" name="phone"
								placeholder="请输入验证码" />

							<!-- <button type="primary" size="mini" class="ckPhone" open-type="getPhoneNumber"
								@getphonenumber="onGetPhoneNumber">获取手机号</button> -->
							<view class="verificationCode" @click="getVerificationCode()">
								{{ count ? count + '秒' : '获取验证码' }}
							</view>

						</view>


					</view>
					<view class="phoneBtn flex" @click="closeBtn()">
						确定
					</view>
				</view>

			</template>
		</sunui-popup>

		<sunui-popup ref="socialScreen">
			<template v-slot:content>

				<view class="padding20" style="background-color: #FFFFFF; ">
					<view class="text-align_center margin-top_20rpx font-weight_bold">
						筛选条件
					</view>
					<view class=" margin-top_20rpx ">
						<view class="font-weight_bold">
							性别
						</view>

						<view class="selectTime flex-align-center">

							<view class=" " style="margin-right: 20rpx; width: 33.3%;"
								v-for="(item, index) in sexScreen" :key="index">
								<view :class="[screenIndex == index ? 'active ' : 'active-a'] "
									@click="switchTimeTab(index,item.value)">
									{{ item.name }}
								</view>
							</view>
						</view>
					</view>
					<view class=" margin-top_20rpx ">
						<view class="font-weight_bold">
							学历
						</view>

						<view class="selectTime flex-wrap-flex-start">

							<view class=" " style="margin-right: 20rpx; width: 30%;"
								v-for="(item, index) in educationScreen" :key="index">
								<view :class="[screenIndex1 == index ? 'active ' : 'active-a'] "
									@click="switchTimeTab1(index,item.value)">
									{{ item.name }}
								</view>
							</view>
						</view>
					</view>
					<view class=" margin-top_20rpx ">
						<view class="font-weight_bold">
							月薪
						</view>

						<view class="selectTime flex-wrap-flex-start">

							<view class=" " style="margin-right: 20rpx; width: 30%;"
								v-for="(item, index) in incomeScreen" :key="index">
								<view :class="[screenIndex2 == index ? 'active ' : 'active-a'] "
									@click="switchTimeTab2(index,item.value)">
									{{ item.name }}
								</view>
							</view>
						</view>
					</view>
					<view class=" margin-top_20rpx ">
						<view class="font-weight_bold">
							婚况
						</view>

						<view class="selectTime flex-wrap-flex-start">

							<view class=" " style="margin-right: 20rpx; width: 30%;"
								v-for="(item, index) in marriageStatus" :key="index">
								<view :class="[screenIndex3 == index ? 'active ' : 'active-a'] "
									@click="switchTimeTab3(index,item.value)">
									{{ item.name }}
								</view>
							</view>
						</view>
					</view>

					<view class="flex-between">
						<view class="flex-column" style="margin-left: 15rpx;" @click="resetFn()">
							<image class="screenRefresh" :src="screenRefresh" mode=""></image>
							<text style="margin-top: 5rpx;">重置</text>
						</view>
						<view class="phoneBtn1 flex" @click="socialScreenFn()">
							确定
						</view>

					</view>
				</view>

			</template>
		</sunui-popup>

	</view>
</template>

<script>
	import Socket from '@/utils/socket.js';
	import daZi from '../../pages/index/home.vue'
	import wechatMoments from '../../pages/index/wechatMoments.vue'
	import serviceList from '../../pages/index/serviceList.vue'
	import socialList from '../../pages/index/socialList.vue'
	// import followList from'../../pages/index/listfollow.vue'  
	import community from '../../pages/index/community.vue'
	import tqbTabbar from '@/components/tqb-tabbar/tqb-tabbar.vue'
	export default {
		components: {

			daZi,
			wechatMoments,
			serviceList,
			socialList,
			// followList,
			community,
			tqbTabbar
		},
		data() {
			const defaultWhere = {
				sex: '1',
				me_qualifications: null,
				income: "1",
				marital_status: '1'
			}
			return {
				defaultWheres: {
					sex: '1',
					me_qualifications: null,
					income: "1",
					marital_status: '1'
				},
				formScreen: {
					...defaultWhere
				},
				sexScreen: [{
					name: '男',
					value: '1'

				}, {
					name: '女',
					value: '2'
				}],
				educationScreen: [{
					name: '不限',
					value: ''


				}, {
					name: '高中以上',
					value: '2'


				}, {
					name: '大专以上',
					value: '3'


				}, {
					name: '本科以上',
					value: '4'


				}, {
					name: '硕士以上',
					value: '5'


				}],
				marriageStatus: [{
					name: '未婚',
					value: '2'

				}, {
					name: '离异',
					value: '3'

				}],

				incomeScreen: [{
					name: '2千及以上',
					value: '1'

				}, {
					name: '5千及以上',
					value: '2'

				}, {
					name: '8千及以上',
					value: '3'

				}, {
					name: '1万及以上 ',
					value: '4'

				}, {
					name: '1.5万及以上',
					value: '5'

				}, ],
				screenIndex: 0,
				screenIndex2: 0,
				screenIndex1: 0,
				screenIndex3: 0,
				cirleIndex: 2,
				camera: this.$img.camera,
				screenRefresh: this.$img.screenRefresh,
				value: 0,
				userInfo: uni.getStorageSync("userInfo"),
				downOption: {
					auto: false
				},
				// 上拉配置项
				upOption: {
					auto: true
				},
				windowHeight: 0,
				title: 'Hello',
				currentIndex: 0,
				cIndex: 0,
				heightSystemss: 0,
				autoplay: true,
				interval: 3000,
				listPoster: [],
				tabs: ['11'],

				labelList: [],
				list: [],
				tabsList: [],
				son_tab: null,
				show: '',
				reachBottomSocial:'',
				reachBottomWechat:'',
				detailInfo: [],
				sort: '',
				circleImgShow: '',


				tabList: [
					// 	{
					// 		name: '搭子',
					// 		id: '1' ,//null
					// 		state:1
					// 	},
					// 	{
					// 		name: '圈子',
					// 		id: '2' ,//null
					// 		state:1
					// 	},

					// 	{
					// 		name: '服务',
					// 		id: '3' ,//null
					// 		state:1
					// 	},
					// 	{
					// 		name: '社交',
					// 		id: '4' ,//null
					// 		state:1
					// 	},

					// 	{
					// 		name: '社群',
					// 		id: '5' ,//null
					// 		state:1
					// 	},

				],

				orderStatusArr: [{
						value: '全部',
						id: 0
					},

					{
						value: '今日',
						id: 1
					},

					{
						value: '前七天',
						id: 2
					},

					{
						value: '最近一个月',
						id: 3
					},

				],
				currentPoseter: '',
				form: {
					phone: '',
					sms_code: ''
				},
				count: 0,
				disableCode: false,
				formTest: {}

			}
		},
		
		onLoad(options) {
			this.getLocations()
			this.messageListTemplateFn()

			if (options.currentIndex) {
				this.value = options.currentIndex
			}

			this.createdgetSystemInfo()
			this.navigationList()

			uni.getSystemInfo({
				success: (res) => {
					this.windowHeight = res.windowHeight - 190
					console.log(this.windowHeight)
				}
			});
			this.$nextTick(() => {

				// 初始化ws
				this.$websocket.initWebsocket()

				// 设置回调
				this.$websocket.setCallback((data) => {
					// 收到消息时的回调逻辑
					console.log(data)
					if (data.client_id) {
						this.client_id = data.client_id
						this.bindUser()
					}
				})

			})


		},

		onShow() {
			console.log('show')
			this.show++


		},
		methods: {
			getLocations() {
				console.log('123')
				uni.getLocation({
					// 将wgs84 改为 gcj02  h5提高精确度
					type: 'wgs84',
					//  geocode: true,   address：地址信息（仅App端支持，需配置geocode为true）
					success: async res => {
						console.log(res)
			
			
						this.updateAddressFn(res.longitude, res.latitude)
			
					},
					fail: res => {
						console.log('123', res)
						this.dimension = res.latitude;
						this.longitude = res.longitude;
					}
				});
			},
			async updateAddressFn(longitude, latitude) {
				const res = await this.$http.post({
					url: this.$api.updateAddress,
					data: {
						dimension: latitude,
						longitude: longitude
			
			
					},
					headers: {
						'Authorization': this.userInfo.token
					}
			
				})
			
				if (res.code == 0) {
			
					this.dimension = latitude;
					this.longitude = longitude;
					this.$sun.toast(res.message, 'none')
					// 掉用户详情获取城市名字
					this.userInfoFn()
			
				} else {
			
					this.$sun.toast(res.message, 'none')
				}
			},
			async userInfoFn() {
				const result = await this.$http.post({
					url: this.$api.userInfo,
					data: {
			
			
			
			
					},
					headers: {
						'Authorization': this.userInfo.token
					}
			
				})
			
				if (result.code == 0) {
					console.log('data', result.data);
					this.userInfoObject = result.data
					wx.setStorageSync('userInfo', this.userInfoObject);
					// this.$nextTick(() => {
					// 	this.mescroll?.resetUpScroll();
					// })
			
				}
			},
			async  messageListTemplateFn() {
				const result = await this.$http.get({
					url: this.$api.messageListTemplate,
					data: {

						
						type: 3,


					},
					headers: {
						
					}

				})

				if (result.code == 0) {
					console.log('messageListTemplate', result.data);
					
					const filteredData = result.data.filter(item => item.id == 3 || item.id == 5||item.id == 6).map((item)=>{
						return item.tid
					});
					
					wx.setStorageSync('messageListTemplate', filteredData);
				

					


				}
			},
			socialScreenFn() {
				console.log(this.formScreen)

				setTimeout(() => {
					this.$refs.socialScreen.close()
				}, 500)
				this.formTest = JSON.parse(JSON.stringify(this.formScreen))
			},
			resetFn() {
				this.screenIndex = 0
				this.screenIndex1 = 0
				this.screenIndex2 = 0
				this.screenIndex3 = 0
				console.log(this.defaultWheres)
				this.formScreen = {
					...this.defaultWheres
				}



			},
			switchTimeTab(index, value) {

				console.log(index)
				this.screenIndex = index
				this.formScreen.name = value
				console.log(this.formTest)


			},
			switchTimeTab1(index, value) {
				console.log(index)
				this.screenIndex1 = index
				this.formScreen.me_qualifications = value
			},
			switchTimeTab2(index, value) {
				console.log(index)
				this.screenIndex2 = index
				this.formScreen.income = value
			},
			switchTimeTab3(index, value) {
				console.log(index)
				this.screenIndex3 = index
				this.formScreen.marital_status = value
			},
			onReachBottom() {
				console.log('监听用户上拉加载')
				
				// 需要判断当前 是那个然后调用那个进行刷新
				
				// wx.setNavigationBarStyle({
				// 	navigationStyle: 'default' // 取消自定义导航栏，恢复默认
				// })
			},
			async userInfoFn() {
				const result = await this.$http.post({
					url: this.$api.userInfo,
					data: {


					},
					headers: {
						'Authorization': this.userInfo.token
					}

				})

				if (result.code == 0) {
					console.log('data', result.data);

					wx.setStorageSync('userInfo', result.data);


				}
			},
			// 验证码码倒计60秒
			countDown(seconds) {
				this.count = seconds;
				var countdownTimer = setInterval(() => {
					this.count--;
					if (this.count === 0) {
						clearInterval(countdownTimer);
						this.disableCode = false;
						// 在这里可以触发验证码过期后的操作
					}
				}, 1000);
			},
			async phoneAuthenticationFn() {
				const result = await this.$http.post({
					url: this.$api.phoneAuthentication,
					data: {

						phoneNumber: this.form.phone,
						sms_code: this.form.sms_code,
						userId: this.userInfo.id



					},
					headers: {
						'Authorization': this.userInfo.token
					}

				})

				if (result.code == 0) {

					this.$sun.toast(result.message, 'none');
					this.userInfoFn()
					setTimeout(() => {
						this.$refs.phoneLogin.close()
					}, 500)
				} else {
					console.log('data', result.data);
					this.$sun.toast(result.message, 'none');
					setTimeout(() => {
						this.$refs.phoneLogin.close()
					}, 500)
				}
			},
			closeBtn() {

				this.phoneAuthenticationFn()



			},
			async getVerificationCode() {
				if (!this.disableCode) {

					if (/^1[3456789]\d{9}$/.test(this.form.phone)) {
						const result = await this.$http.post({
							url: this.$api.sendSmsRequest,
							data: {

								phone: this.form.phone
							}
						});

						if (result.code == 0) {

							this.disableCode = true;
							this.countDown(60);
						} else {
							this.$sun.toast(result.message, 'none');
						}

					} else {
						this.$sun.toast('请填写正确的手机号', 'none');
					}
				}
			},
			communityPhoneBolFn(val) {
				this.$refs.phoneLogin.show({
					anim: 'bottom',
					position: 'bottom',
					shadeClose: true, //false使用户不能点击其它关闭页面
					topclose: false,
					// shade:false,
					zIndex: 100000

				});
			},
			socialSortBolFn() {
				this.formTest = JSON.parse(JSON.stringify(''))
				console.log(this.formTest)
				this.$refs.socialScreen.show({
					anim: 'bottom',
					position: 'bottom',
					shadeClose: true, //false使用户不能点击其它关闭页面
					topclose: false,
					// shade:false,
					zIndex: 100000

				});
			},
			async navigationList() {
				const res = await this.$http.get({
					url: this.$api.menuAS,
					data: {


					},
					headers: {
						'Authorization': this.userInfo.token
					}

				})
				console.log(res.data)

				this.tabList = res.data.map((item) => {
					return {
						id: item.id,
						name: item.new_name,
						state: item.state
					}
				})
				const filterNmae=this.tabList.filter(item=>{
					return item.state==1
				})
				this.tabList=filterNmae
				this.currentPoseter = this.tabList[0].id

				if (this.currentPoseter == 2) {
					this.circleImgShow = 2
				}
			},
			createdgetSystemInfo() {
				let menuButtonObject = uni.getMenuButtonBoundingClientRect(); //获取菜单按钮（右上角胶囊按钮）的布局位置信息。坐标信息以屏幕左上角为原点。
				uni.getSystemInfo({
					//获取系统信息
					success: res => {
						let navHeight = menuButtonObject.height + (menuButtonObject.top - res
							.statusBarHeight) * 2; //导航栏高度=菜单按钮高度+（菜单按钮与顶部距离-状态栏高度）*2
						this.heightSystemss = navHeight;
					},
					fail(err) {
						console.log(err);
					}
				});
			},
			authorityFn(index) {
				if (!(index == 3)) {
					this.sort = index
					this.$refs.modifyEmployeeInfo.close()

				} else {
					this.sort = ''
					this.$refs.modifyEmployeeInfo.close()
				}
				this.$nextTick(() => {
					this.mescroll?.resetUpScroll();
				})
			},
			shareMessageFn() {
				if (this.currentPoseter == 1) {
					return {

						title: wx.getStorageSync('system').distribution_title ? wx.getStorageSync('system')
							.distribution_title : '搭子',
						path: '/pages/index/index?invite=' + uni.getStorageSync("userInfo").invite_code +
							'&currentIndex=' + this.value,
						imageUrl: wx.getStorageSync('system').distribution_poster ? wx.getStorageSync('system')
							.distribution_poster : '',
						desc: wx.getStorageSync('system').distribution_instructions ? wx.getStorageSync('system')
							.distribution_instructions : '搭子'
					}
				} else if (this.currentPoseter == 2) {
					return {

						title: wx.getStorageSync('system').coterie_distribution_title ? wx.getStorageSync('system')
							.coterie_distribution_title : '圈子',
						path: '/pages/index/index?invite=' + uni.getStorageSync("userInfo").invite_code +
							'&currentIndex=' + this.value,
						imageUrl: wx.getStorageSync('system').coterie_distribution_poster ? wx.getStorageSync('system')
							.coterie_distribution_poster : '',
						desc: wx.getStorageSync('system').coterie_distribution_instructions ? wx.getStorageSync('system')
							.coterie_distribution_instructions : '圈子'
					}
				} else if (this.currentPoseter == 3) {
					return {

						title: wx.getStorageSync('system').service_distribution_title ? wx.getStorageSync('system')
							.service_distribution_title : '服务',
						path: '/pages/index/index?invite=' + uni.getStorageSync("userInfo").invite_code +
							'&currentIndex=' + this.value,
						imageUrl: wx.getStorageSync('system').service_distribution_poster ? wx.getStorageSync('system')
							.service_distribution_poster : '',
						desc: wx.getStorageSync('system').service_distribution_instructions ? wx.getStorageSync('system')
							.service_distribution_instructions : '服务'
					}
				} else if (this.currentPoseter == 4) {
					return {

						title: wx.getStorageSync('system').social_distribution_title ? wx.getStorageSync('system')
							.social_distribution_title : '社交',
						path: '/pages/index/index?invite=' + uni.getStorageSync("userInfo").invite_code +
							'&currentIndex=' + this.value,
						imageUrl: wx.getStorageSync('system').social_distribution_poster ? wx.getStorageSync('system')
							.social_distribution_poster : '',
						desc: wx.getStorageSync('system').social_distribution_instructions ? wx.getStorageSync('system')
							.social_distribution_instructions : '社交'
					}
				} else if (this.currentPoseter == 5) {
					return {

						title: wx.getStorageSync('system').community_distribution_title ? wx.getStorageSync('system')
							.community_distribution_title : '社群',
						path: '/pages/index/index?invite=' + uni.getStorageSync("userInfo").invite_code +
							'&currentIndex=' + this.value,
						imageUrl: wx.getStorageSync('system').community_distribution_poster ? wx.getStorageSync('system')
							.community_distribution_poster : '',
						desc: wx.getStorageSync('system').community_distribution_instructions ? wx.getStorageSync('system')
							.community_distribution_instructions : '社群'
					}
				}
			},
			onShareAppMessage() {
				return this.shareMessageFn()
			},
			// 分享朋友圈(微信小程序)
			onShareTimeline() {
				return this.shareMessageFn()
			},
			sortBolFn(val) {
				console.log(val)
				this.$refs.modifyEmployeeInfo.show({
					anim: 'bottom',
					position: 'bottom',
					shadeClose: true, //false使用户不能点击其它关闭页面
					topclose: false,
					zIndex: 100000,

				});
			},
			circleSortBolFn(val) {
				console.log(val)
				this.$refs.modifyEmployeeInfo.show({
					anim: 'bottom',
					position: 'bottom',
					shadeClose: true, //false使用户不能点击其它关闭页面
					topclose: false,
					zIndex: 100000,

				});
			},
			serviceSortBolFn(val) {
				console.log(val)
				this.$refs.modifyEmployeeInfo.show({
					anim: 'bottom',
					position: 'bottom',
					shadeClose: true, //false使用户不能点击其它关闭页面
					topclose: false,
					zIndex: 100000,

				});
			},
			addEmployeeSuspension() {
				this.$sun.navGo('/pagesB/index/publishCircle')
			},
			async bindUser() {
				const resPoster = await this.$http.post({
					url: this.$api.bindUser,
					data: {

						type: 'notice',
						uid: '',
						client_id: this.client_id


					},
					headers: {
						'Authorization': this.userInfo.token
					}

				})

				if (resPoster.code == 0) {
					console.log(resPoster)
					// this.$sun.toast(resPoster.message, 'none')

				} else {

					// this.$sun.toast(resPoster.msg, 'none')
				}

			},
			onReachBottom() {
				console.log('监听用户上拉加载')
				console.log(this.currentPoseter)
				if(this.currentPoseter==4){
					this.reachBottomSocial++
					
				}else if(this.currentPoseter==2){
					this.reachBottomWechat++
					
				}
				// 需要判断当前 是那个然后调用那个进行刷新
				
				// wx.setNavigationBarStyle({
				// 	navigationStyle: 'default' // 取消自定义导航栏，恢复默认
				// })
			},
			changeIndex(e, item) {
				console.log(e)
				this.currentPoseter = item
				this.circleImgShow = item
				this.value = e.value
				this.show++
			},

			formatTimeDifference(timestamp) {
				// 获取当前时间的时间戳（以秒为单位）
				const currentTimestamp = Math.floor(Date.now() / 1000);

				// 计算时间差（以秒为单位）
				let timeDifference = timestamp - currentTimestamp;

				// 计算天数
				const days = Math.floor(timeDifference / (24 * 60 * 60));
				timeDifference %= (24 * 60 * 60);

				// 计算小时
				const hours = Math.floor(timeDifference / (60 * 60));
				timeDifference %= (60 * 60);

				// 计算分钟
				const minutes = Math.floor(timeDifference / 60);

				// 剩余的秒数
				const seconds = timeDifference % 60;

				return {
					days: days,
					hours: hours,
					minutes: minutes,
					seconds: seconds
				};
			},
			classifyListNav() {
				console.log('点击了')
				this.$sun.navGo('/pages/index/classifyAll')
			},
			goDeatilFn(id) {
				console.log(id)
				this.$sun.navGo('/pages/index/buildSubDetail', {
					id: id
				})
			},
			viewMoreFn() {

				this.$sun.navGo('/pages/index/buildSubList')
			},

			getChange(index, e) {
				console.log(index, e)

				this.currentIndex = index

				this.$sun.navGo('/pages/index/wechatMoments')

			},
			// 点击轮播图
			clickSlideImg(e) {
				// 跳本地 ， 2 跳h5 ，3 跳小程序
				if (e.jump_way == 1) {
					this.$sun.toast('目前暂不支持本地跳转', 'none')
				} else if (e.jump_way == 2) {
					window.location.href = e.link
				}

			},
			async tabClassIfyFn() {
				console.log(this.userInfo.token)
				const resPoster = await this.$http.post({
					url: this.$api.tabList,
					data: {

						type: 3,
						// pid:0,
						top: 1

					},
					headers: {
						'Authorization': this.userInfo.token
					}

				})

				if (resPoster.code == 0) {
					console.log(resPoster)
					this.tabsList = resPoster.data.list
					if (resPoster.data.list.length) {
						this.son_tab = resPoster.data.list[0].id
					}
					this.tabs = resPoster.data.list.slice(0, 5).map((item) => {
						return item.name;
					});
					this.$nextTick(() => {
						this.mescroll?.resetUpScroll();
					})

				} else {

					this.$sun.toast(resPoster.message, 'none')
				}
			},
			// 获取轮播图
			async init() {
				const resPoster = await this.$http.post({
					url: this.$api.poster,
					data: {

						type: 3

					},
					headers: {
						'Authorization': `Bearer ${this.token}`
					}

				})

				if (resPoster.code == 0) {




					// 	// 展示区域  1 首页 2 商城 3 套餐卡市场 这里还需要区分

					this.listPoster = resPoster.data.filter(item => item.type == 3);
					console.log(this.listPoster)




				} else {

					this.$sun.toast(resPoster.message, 'none')
				}



			},

			changeTab(index, id) {
				console.log('当前选中的项：' + index, id)
				this.son_tab = id
				this.$nextTick(() => {
					this.mescroll?.resetUpScroll();
				})

			}

		}
	}
</script>

<style lang="less" scoped>
	.screenRefresh {
		width: 34.98rpx;
		height: 39.98rpx;
	}

	.selectTime {

		margin: 20rpx 0;
		width: 375px;


		.active {


			padding: 10rpx 20rpx;
			border-radius: 100rpx;
			margin: 20rpx 4rpx;
			background: rgb(139, 96, 222);


			color: rgb(255, 255, 255);
			;
			text-align: center;


		}

		.active-a {


			padding: 10rpx 20rpx;
			margin: 20rpx 4rpx;

			border-radius: 100rpx;

			background: #F8F8F8;


			color: rgb(153, 153, 153);
			;
			text-align: center;

		}

		.orderStatus {
			width: 90px;
			height: 50rpx;
			text-align: center;
			line-height: 50rpx;
			font-weight: 700;

		}




	}

	.phoneBtn {
		margin-top: 40rpx;

		height: 100rpx;
		border-radius: 130rpx;
		color: #fff;
		background: rgb(139, 96, 222);

	}

	.phoneBtn1 {

		width: 80%;
		height: 100rpx;
		border-radius: 130rpx;
		color: #fff;
		background: rgb(139, 96, 222);

	}

	.getPhone {
		height: 96rpx;
		border-radius: 124rpx;
		padding-left: 20rpx;
		background: #f5f5f9;
		position: relative;

		.ckPhone {
			height: 96rpx;
			line-height: 100rpx;
			width: 220rpx;
			background-color: transparent;
			color: #000;
		}

		.verificationCode {
			z-index: 999;
			position: absolute;
			right: 0;
			text-align: center;
			width: 170rpx;
			height: 65rpx;
			line-height: 65rpx;
			border-radius: 100rpx;
			font-size: 20rpx;
			background: #7D5CF7;
			color: #fff;
		}
	}

	.moreActiveButton {


		background-color: #fff;

		.flex-center() {
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.moreActiveButton {


			background-color: #fff;


			.add {
				height: 100rpx;
				color: #6568F6;
				font-size: 28rpx;
				font-family: Inter;

				.flex-center();
				border: 2rpx solid #f7f7f7;


			}

			.delete {
				.flex-center();
				height: 100rpx;


				color: #FF4636;
				font-size: 28rpx;
				font-family: Inter;
				box-shadow: 2rpx 2rpx 2rpx 30rpx 30rpx rgba(238, 238, 238, 1.0);
			}


		}

		.add {
			height: 100rpx;
			color: #6568F6;
			font-size: 28rpx;
			font-family: Inter;

			.flex-center();
			border: 1px solid #f7f7f7;


		}

		.delete {
			.flex-center();
			height: 100rpx;


			color: #FF4636;
			font-size: 28rpx;
			font-family: Inter;
			box-shadow: 2rpx 2rpx 2rpx 30rpx 30rpx rgba(238, 238, 238, 1.0);
		}


	}

	.widthFiximg {
		position: absolute;
		z-index: 0;
		width: 100%;
	}

	.suspension {
		position: fixed;
		right: 0rpx;
		width: 100rpx;
		bottom: 260rpx;
		height: 100rpx;
		border-radius: 50%;
		background-color: #fff;
		text-align: center;
		line-height: 100rpx;
		z-index: 999;
		filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.15));

		.addIcon {

			width: 105rpx;
			height: 105rpx;
		}
	}

	.bg {
		background-repeat: no-repeat;
		background-size: cover;

		// height: 100vh;

		.buildContainer {
			padding: 20rpx;

			.line {
				width: 10rpx;
				height: 30rpx;
				border-radius: 106rpx;
				margin-right: 10rpx;
				background: rgb(120, 93, 246);
			}

			.buildList {

				display: flex;
				flex-direction: column;
				align-items: flex-start;
				padding: 20rpx;
				background: rgb(255, 255, 255);
				margin-top: 20rpx;
				border-radius: 20rpx;

				.tagImg {
					width: 118rpx;
					height: 38rpx;
				}

				.addImg {
					width: 30.02rpx;
					height: 30.02rpx;
				}

				.tagTitle {
					padding: 10rpx 20rpx;
					height: 36rpx;
					border-radius: 12rpx 12rpx 24rpx 12rpx;
					font-size: 20rpx;
					color: rgb(0, 198, 141);
					background: rgb(212, 255, 249);
					margin-right: 5rpx;
				}

				.avaterImg {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					margin-right: 8rpx;
				}

				.tagTitleGay {
					padding: 10rpx 20rpx;
					height: 36rpx;
					border-radius: 12rpx 12rpx 24rpx 12rpx;
					font-size: 20rpx;
					color: #666666;
					background: #F5F5F5;
					margin-right: 5rpx;
				}

				.tagTitleOrange {
					padding: 10rpx 20rpx;
					height: 36rpx;
					border-radius: 12rpx 12rpx 24rpx 12rpx;
					font-size: 20rpx;
					color: rgb(238, 100, 41);
					background: rgba(238, 100, 41, 0.13);
					;
					margin-right: 5rpx;
				}

				.tagTitlePink {
					width: 116rpx;
					height: 36rpx;
					border-radius: 12rpx 12rpx 24rpx 12rpx;
					font-size: 20rpx;
					color: #F95CEF;
					background: #FFF2F8;
					margin-right: 5rpx;
				}

				.location {
					width: 110rpx;
					height: 48rpx;
					border-radius: 20rpx;

					background: rgb(235, 245, 255);
				}

				.pt_img {
					width: 50rpx;
					height: 50rpx;
					margin-right: -30rpx;
					border-radius: 50%;
				}

				.v-p-share {
					padding: 2rpx 2rpx 0 2rpx;

					.v-m-width {
						margin-right: 40rpx;

						.pt_img {
							width: 50rpx;
							height: 50rpx;
							margin-right: -30rpx;
							border-radius: 50%;
						}
					}

					.v-share-friend {
						text {
							color: #294d7d;
							font-size: 24rpx;
							padding-right: 50rpx;
						}

						view {
							color: #ffffff;
							width: 154rpx;
							height: 58rpx;
						}
					}

					.v-share-friend2 {
						text {
							color: #294d7d;
							font-size: 24rpx;
						}
					}
				}

				.orderImg {
					width: 192rpx;
					height: 192rpx;
					border-radius: 30rpx;


				}

				.addressImg {
					width: 28.5rpx;
					height: 28.12rpx;
				}
			}
		}

		.logo {
			height: 100vh;
			width: 100vw;
			margin-top: 200rpx;
			margin-left: auto;
			margin-right: auto;
			margin-bottom: 50rpx;
		}

		.text-area {
			display: flex;
			justify-content: center;
		}

		.title {
			font-size: 36rpx;
			color: #8f8f94;
		}

		.carouselChart {
			padding: 0 20rpx;
		}

		.search-content {

			// justify-content: center;
			display: flex;
			align-items: center;
			margin: 20rpx;
			height: 76rpx;
			margin-right: 24rpx;
			background: rgb(246, 248, 255);
			;
			border-radius: 84rpx;


			.search-img {
				width: 30rpx;
				height: 30rpx;
				margin-right: 20rpx;
				margin-left: 20rpx;
			}

			.address-img {
				width: 30rpx;
				height: 30rpx;
				margin-right: 10rpx;
				margin-left: 20rpx;
			}

			.icon_close {
				padding: 0rpx 15rpx;
				width: 36rpx;
				height: 36rpx;
				margin-right: 30rpx;
			}

		}
	}
</style>